package org.tgcloud.group.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.tgcloud.group.entity.MjProjectBatch;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author: zhy
 * @Created: 2025-08-26-上午11:48
 * @Description: ${description}
 */
public interface MjProjectBatchMapper extends BaseMapper<MjProjectBatch> {
    int deleteByPrimaryKey(Integer id);

    int insert(MjProjectBatch record);

    int insertSelective(MjProjectBatch record);

    MjProjectBatch selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MjProjectBatch record);

    int updateByPrimaryKey(MjProjectBatch record);

    List<MjProjectBatch> selectBatchByProjectId(Integer projectBatchId);

    Integer selectProjectBatchMax(Integer projectBatchId);

    MjProjectBatch selectProjectBatchMaxTime(Integer projectBatchId);

    Integer selectArriveRateSum(@Param("projectId") Integer projectId);

    BigDecimal selectMonthArriveRate(@Param("arrivalTime") Date arrivalTime, @Param("projectId") Integer projectId);

    BigDecimal selectQuarterArriveRate(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("projectId") Integer projectId);

    BigDecimal selectYearArriveRate(@Param("arrivalTime") Date arrivalTime, @Param("projectId") Integer projectId);

    int updateProjectBatchById(@Param("arrivalRate") BigDecimal arrivalRate, @Param("arrivalTime") Date arrivalTime, @Param("id") Integer id);

    int updateStatusById(@Param("status") Short status, @Param("id") Integer id);
}